package playon.playlist;

import java.util.*;
import javax.ejb.*;

public class PlaylistBean implements SessionBean {

  private Vector playlist;

  /* manipulation de la playlist */

  public void addSong(Song song) {
    this.playlist.addElement(song);
  }

  public Song getSong(int i) {
    if((i <= 0) || (i>this.playlist.size()))
      return null;
    else
      return (Song)this.playlist.elementAt(i);
  }

  /* implementation de SessionBean */

  public void ejbCreate() {
    this.playlist = new Vector();
  }

  public void ejbRemove() {}

  public void ejbActivate() {}

  public void ejbPassivate() {}

  public void setSessionContext(SessionContext ctx) {}

}

